package com.swt.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.swt.service.RolePowerService;
import com.swt.domain.RolePower;
import com.swt.mapper.RolePowerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 苏
* @description 针对表【yesapi_shopxo_s_role_power(ShopXO商城-角色与权限管理)】的数据库操作Service实现
* @createDate 2022-05-16 15:21:33
*/
@Service
public class RolePowerServiceImpl implements RolePowerService {
    @Autowired
    private RolePowerMapper powerMapper;

    @Override
    public List<RolePower> selectAllpower() {
        return powerMapper.selectList(null);
    }

    @Override
    public int delectpower(String id) {
        return powerMapper.deleteById(id);
    }

    @Override
    public int updatepower(RolePower power) {
        return powerMapper.updateById(power);
    }

    @Override
    public int inserpower(RolePower power) {
        return powerMapper.insert(power);
    }

    @Override
    public RolePower selectbypowerid(String id) {
        return powerMapper.selectById(id);
    }

    @Override
    public Page<RolePower> pagepower(Integer page, Integer start) {
        Page<RolePower> userPge = new Page<>(page,start);
        return powerMapper.selectPage(userPge,null);
    }
}




